package bookTest;

public class Circle {
    protected double r;
    protected double pi = 3.1415926;
    public Circle(){}
    public Circle(double r){
        this.r = r;
    }

    public void setR(double r) {
        this.r = r;
    }

    public double getPi() {
        return pi;
    }

    public double getR() {
        return r;
    }
    public double circumference(){
        return 2*pi*r;
    }
    public double area(){
        return pi*r*r;
    }
    @Override
    public String toString(){
        //System.out.println("周长："+this.circumference()+" 面积："+this.area());
        return "周长："+this.circumference()+" 面积："+this.area();
    }
}
